<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml" xmlns:shiro="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header">

</head>
<style>
	.main{
        margin: 16px 0 0 0;
        width:100%;
        height:auto;
    }
    .name{
        font-size: 14px;
        font-weight: bold;
        margin-top: 16px;
        height: 48px;
        line-height: 48px;
        padding-left: 16px;
        color: #3F4F60;
        border-radius: 4px;
        background: #fff;
    }
    .echart-box{
        background: #fff;
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 4px;
    }
    .echart-box{
        clear: both;
        overflow: hidden;
    }
    .echart-box .item{
        float: left;
        width: 31%;
        margin-right: 2.333%;
        border-radius: 4px;
    }
    .echart-box .tit{
        font-size: 18px;
        padding: 16px 0;
        color: #06172A;
        position: relative;
        font-weight: bold;
        margin-left: 2px;
        border-bottom: 1px solid #eef0f3;
    }
    .echart-box .text{
        color: #5a5f72;
        margin: 8px 0;
        position: relative;
        padding-left: 10px;
     }
    .echart-box .text:after{
        content: '';
        width: 4px;
        height: 14px;
        background: #2C82EB;
        position: absolute;
        left: 0;
        top: 50%;
        margin-top: -7px;
    }
    .echart-box .num{
        font-size: 30px;
        font-size: bold;
        padding-bottom: 8px;
        border-bottom: 1px solid #ccc;
    }
    .echart-box-two{
        background: #fff;
        padding: 0 18px 18px 18px;

    }
    .echart-box-two .item{
        background: #fff;
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <p class="name">全国职业院校技能大赛 -- 婴幼儿保育赛项</p>
    <div id="main" class="main">
        <div class="echart-box-two echart-box">
            <div class="item" style="width: 100%">
                <p class="tit">得分区间分布图（百分制）</p>
                <div id="intervalScoreEcharts" style="height:356px"></div>
                <table class="layui-table">
                    <!--                    <colgroup>-->
                    <!--                        <col width="150">-->
                    <!--                        <col width="150">-->
                    <!--                        <col>-->
                    <!--                    </colgroup>-->
                    <thead>
                    <tr>
                        <th></th>
                        <th>0-60分</th>
                        <th>61-70分</th>
                        <th>71-80分</th>
                        <th>81-90分</th>
                        <th>90-100分</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr id="zhiye">
                        <td>职业素养测评</td>
                    </tr>
                    <tr  id="baoyu">
                        <td>婴幼儿保育技能实操</td>
                    </tr>
                    <tr id="zaoqi">
                        <td>婴幼儿早期学习支持</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script src="/js/plugins/echarts/echarts.min.js"></script>
<script type="text/javascript" >
    $(function() {

        $.ajax({
            url: "/jzweb/examinationCostStatistic/scoreRangeList",
            type: "get",
            data: {
            },
            success: function (r) {
                if(r==null){
                    layer.msg("未查询到数据！");
                }
                else {
                    let getData = r.data
                    intervalScoreEcharts(getData.zysycpList,getData.yyrbyjnList,getData.zqxxzcList) //得分区间分布图（百分制）

                    var zhiye = `<td>职业素养测评</td>`
                    $.each(getData.zysycpList, function(index, value) {
                        zhiye+= '<td>'+value+'</td>'
                    })
                    $('#zhiye').html(zhiye)

                    var baoyu = `<td>婴幼儿保育技能实操</td>`
                    $.each(getData.yyrbyjnList, function(index, value) {
                        baoyu+= '<td>'+value+'</td>'
                    })
                    $('#baoyu').html(baoyu)

                    var zaoqi = `<td>婴幼儿早期学习支持</td>`
                    $.each(getData.zqxxzcList, function(index, value) {
                        zaoqi+= '<td>'+value+'</td>'
                    })
                    $('#zaoqi').html(zaoqi)



                }
            }
        });


    })
    function intervalScoreEcharts(zysycpList,yyrbyjnList,zqxxzcList){
        var dom = document.getElementById("intervalScoreEcharts");
        var myChart = echarts.init(dom);
        var option;
        option = {
            // tooltip: {
            //     trigger: 'axis'
            // },
            tooltip: {
                trigger: 'axis',
                show:false,
                //formatter: '{b} : {c}人',
            },
            legend: {//图例
                show:true,
                x : 'center',
                y : 'bottom',
                itemHeight: 12,                      //修改icon图形大小
                icon: 'circle',                         //图例前面的图标形状
            },
            grid: {
                left: '0',
                right: '0',
                bottom: '10%',
                containLabel: true
            },
            xAxis: {
                show:false,
                type: 'category',
                boundaryGap: true, // 将 boundaryGap 设置为 true
            },
            yAxis: {
                type: 'value',
                // max:100,
                // min:0,
                splitLine:{
                    show:true,
                    lineStyle:{
                        type:'dashed'
                    }
                },
            },

            series: [

                {
                    name: '职业素养测评',
                    type: 'line',
                    color:'#78cbd1',
                    smooth: true,
                    lineStyle: {
                        color: '#78cbd1', // 设置线的颜色为红色
                    },
                    label: {
                        show: true,
                        position: 'bottom',
                        color:'#3F4F60'
                    },
                    data: zysycpList,
                },
                {
                    name: '婴幼儿保育技能实操',
                    type: 'line',
                    smooth: true,
                    color:'#ffd5b9',
                    lineStyle: {
                        color: '#ffd5b9', // 设置线的颜色为红色
                    },
                    label: {
                        show: true,
                        position: 'bottom',
                        color:'#3F4F60'
                    },
                    data: yyrbyjnList,
                },
                {
                    name: '婴幼儿早期学习支持',
                    type: 'line',
                    color:'#937af9',
                    smooth: true,
                    lineStyle: {
                        color: '#937af9', // 设置线的颜色为红色
                    },
                    label: {
                        show: true,
                        position: 'bottom',
                        color:'#3F4F60'
                    },
                    data: zqxxzcList,
                },
            ]
        };
        if (option && typeof option === 'object') {
            myChart.setOption(option);
        }
    }

</script>
</body>
</html>